<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>19-作业</title>
  <style>
    .box {
      width: 300px;
      height: 300px;
      border: 1px solid #000;
    }
  </style>
</head>
<body>
  <div id="app" class="box" :style="{backgroundColor:color}">
    <h1>vue的例子</h1>
    <p>{{msg}}</p>
    <my-demo></my-demo>
  </div>
  <script src="../js/vue.js"></script>
  <script>
    Vue.config.productionTip = false; // 关闭生产提示
    Vue.component('my-demo',{
      template:`<div>
          <h2>我是一个demo子组件</h2>
          <button>红色</button>
          <button>蓝色</button>
          <button>紫色</button>
        </div>`
    })
    const vm = new Vue({
      el: '#app',
      data: {
        msg: 'hello',
        color:''
      }
    })
  </script>
</body>
</html>